import $app from '@$@/js/$app';
import $router from '@/router'
let colB = {
  list(that){
    let out=[
      {
        title: " ",
        type: "index",
        width: 30,
        align: "center ",
        className: "goOnTxt c999"
      },
      {
        type: "selection",
        className: "goOnTxt",
        align: "center",
        width: 40
      },
      {
        title: "专利名称",
        key: "patent_name",
        className: "goOnTxt",
        resizable: true,
      },
      {
        title: "申请号",
        width: 150,
        className: "goOnTxt",
        resizable: true,
        render: (h, params) => {
          let {
            row:{
              patent_apply_number:patent_no,
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: " cBlue pointer",
                on:{
                  click:()=>{
                    // 页面跳转
                    $router.push({
                      name: 'patentInfo',
                      query: {
                        patent_no,
                        type:1
                      }
                    })
                  }
                }
              },
              patent_no
            )
          ];
  
  
  
          return out;
        }
      },
      {
        title: "专利类型",
        align: "center",
        width: 120,
        className: "goOnTxt",
        key: "patent_type",
        resizable: true,
      },
      {
        title: "导入日期",
        align: "center",
        width: 100,
        sortable: 'custom',//如果设置为 custom，则代表用户希望远程排序
        sortType:(that.order=='created_at')?that.order_type:'',
        className: "goOnTxt",
        key: "created_at",
        resizable: true,
      },
      {
        title: "申请日期",
        align: "center",
        width: 100,
        sortable: 'custom',//如果设置为 custom，则代表用户希望远程排序
        sortType:(that.order=='patent_apply_day')?that.order_type:'',
        className: "goOnTxt",
        key: "patent_apply_day",
        resizable: true,
      },
      {
        title: "法律状态",
        key: "legal_status",
        align: "center",
        width: 110,
        className: "goOnTxt",
        resizable: true,
      },
      {
        title: "申请人",
        className: "goOnTxt",
        resizable: true,
        render: (h, params) => {
          let {
            row:{
              patent_applicant_one,
            }
          } = params;
          let out = [
            h(
              "span",
              {
                class: " cBlue pointer",
                on:{
                  click:()=>{
                    $app.closeHadPage("patentList", () => {
                      // 页面跳转
                      $router.push({
                        name: "patentList",
                        query: {
                          query_key: patent_applicant_one,
                          type:3
                        }
                      });
                    });
                  }
                }
              },
              patent_applicant_one
            )
          ];
  
  
  
          return out;
        }
      },
      {
        title: "数据来源",
        key: "source",
        width: 130,
        className: "goOnTxt",
        resizable: true,
      },
      {
        title: "操作",
        className: "goOnTxt",
        render: (h, params) => {
          let {
            row: {
              patent_apply_number1,
              patent_name,
              has_fee,//相关的费用
              has_year_fee//年费
            }
          } = params;
          let out = [];
    
          if(has_year_fee){
            out.push(
              h(
                "span",
                {
                  class: "  marginR10  cBlue textLink",
                  on: {
                    click: () => {
                      that.woRb(patent_apply_number1)
                    }
                  }
                },
                `续费`
              )
            );
          }
          

          if(has_fee){
            out.push(
              h(
                "span",
                {
                  class: "  marginR10 c999 textLink",
                  on: {
                    click: () => {
                      that.xwtwPP(patent_apply_number1,patent_name);
                    }
                  }
                },
                `费用明细`
              ),
            );
          }

          if(!$app.judgeData(out)){
            out=[
              h(
                "span",
                {
                  class: "cCCC",
                  on: { }
                },
                ` - `
              )
            ];
          }
          
    
    
          
    
          return out;
        }
      }
    ];
    return out;
  }
}

// 表格 列 配置
export default colB;